<!--Gordana Pejic 191/01-->
<?php 
require '../pages/db.php';
$con=dbConnect("sib");
$result=mysql_query("SELECT * FROM hostel", $con);

echo'
<div class="admin-hostels">
    <div class="admin-title">
        <h2>Hostels</h2>
        <h4><a href="hostel-add.php">Add hostel</a></h4>
    </div>


    <div class="admin-content">
        <table border="0" align="center">
           <thead>
                <tr>
                    <th>Hostel ID</th>
                    <th>Name</th>
                    <th>Edit</th>
                    <th>Delete</th>
                    <th>Feedback</th>
                    <th>Add photo</td>
                </tr>
          
            </thead>
            <tbody>';
           while($row = mysql_fetch_array($result)){
            echo '
                <tr>
                    <td>'.$row["IDHostel"].'</td>
                    <td>'.$row["Name"].'</td>
                    <td><a href="hostel-e.php?hid='.$row["IDHostel"].'" >Edit</a></td>
                    <td><a href="hostel-d.php?hid='.$row["IDHostel"].'" >Delete</a></td>
                    <td><a href="hostel-feedback.php?hid='.$row["IDHostel"].'" >Feedback</a></td>
                    <td><a href="hostel-add_photo.php?hid='.$row["IDHostel"].'" >Add photo</a></td>
                </tr>';

            };
            echo'
            </tbody>
        </table>

    </div>
</div>';
           
 mysql_close($con);
 ?>
